package org.example.config;

/**
 * 存储配置属性
 */
public class StorageProperties {
    // 会话存储配置
    private int maxSessions = 10000;
    private long sessionTimeout = 600000; // 10 minutes
    private long cleanupInterval = 60000; // 1 minute
    private float evictionThreshold = 0.9f;

    // 投注存储配置
    private int maxHighStakes = 20;
    private boolean enableBettingCache = true;
    private long bettingCacheTimeout = 30000; // 30 seconds

    // 监控配置
    private long monitorInterval = 30000; // 30 seconds

    // Getter and Setter methods
    public int getMaxSessions() { return maxSessions; }
    public void setMaxSessions(int maxSessions) { this.maxSessions = maxSessions; }

    public long getSessionTimeout() { return sessionTimeout; }
    public void setSessionTimeout(long sessionTimeout) { this.sessionTimeout = sessionTimeout; }

    public long getCleanupInterval() { return cleanupInterval; }
    public void setCleanupInterval(long cleanupInterval) { this.cleanupInterval = cleanupInterval; }

    public float getEvictionThreshold() { return evictionThreshold; }
    public void setEvictionThreshold(float evictionThreshold) {
        this.evictionThreshold = Math.min(evictionThreshold, 1.0f);
    }

    public int getMaxHighStakes() { return maxHighStakes; }
    public void setMaxHighStakes(int maxHighStakes) { this.maxHighStakes = maxHighStakes; }

    public boolean isEnableBettingCache() { return enableBettingCache; }
    public void setEnableBettingCache(boolean enableBettingCache) { this.enableBettingCache = enableBettingCache; }

    public long getBettingCacheTimeout() { return bettingCacheTimeout; }
    public void setBettingCacheTimeout(long bettingCacheTimeout) { this.bettingCacheTimeout = bettingCacheTimeout; }

    public long getMonitorInterval() { return monitorInterval; }
    public void setMonitorInterval(long monitorInterval) { this.monitorInterval = monitorInterval; }
}